package com.hgkj.cloud.base.service.impl;

import com.hgkj.cloud.base.common.PageInfo;
import com.hgkj.cloud.base.dao.TenantPsychologicalCaseMapper;
import com.hgkj.cloud.base.domain.TenantPsychologicalCase;
import com.hgkj.cloud.base.service.TenantPsychologicalCaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service
public class TenantPsychologicalCaseServiceImpl implements TenantPsychologicalCaseService {

    @Autowired
    private TenantPsychologicalCaseMapper tenantPsychologicalCaseMapper;
    @Override
    public int deleteByPrimaryKey(Long id) {
        return tenantPsychologicalCaseMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(TenantPsychologicalCase record) {
        return tenantPsychologicalCaseMapper.insert(record);
    }

    @Override
    public int insertSelective(TenantPsychologicalCase record) {
        return tenantPsychologicalCaseMapper.insertSelective(record);
    }

    @Override
    public TenantPsychologicalCase selectByPrimaryKey(Long id) {
        return tenantPsychologicalCaseMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(TenantPsychologicalCase record) {
        return tenantPsychologicalCaseMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(TenantPsychologicalCase record) {
        return tenantPsychologicalCaseMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<Map<String, Object>> listPsychologicalCaseByMap(PageInfo pi, Map<String, Object> map) {
        if(pi != null){
            map.put("currentCount", pi.getCurrentCount());
            map.put("pageSize", pi.getPageSize());
        }
        return tenantPsychologicalCaseMapper.listPsychologicalCaseByMap(map);
    }

    @Override
    public long listPsychologicalCaseCount(Map<String, Object> map) {
        return tenantPsychologicalCaseMapper.listPsychologicalCaseCount(map);
    }

    @Override
    public int delPsychologicalCase(Long id) {
        return tenantPsychologicalCaseMapper.delPsychologicalCase(id);
    }

    @Override
    public TenantPsychologicalCase getPsychologicalCaseById(Map<String, Object> map) {
        return tenantPsychologicalCaseMapper.getPsychologicalCaseById(map);
    }

    @Override
    public List<Map<String, Object>> getPsychologicalCaseStatistics(Map<String, Object> map) {
        return tenantPsychologicalCaseMapper.getPsychologicalCaseStatistics(map);
    }
}
